<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<script language="javascript">
	function setEtat(etat) {
		var input = document.getElementById('tac_charge_etat_suivant');
		input.value = etat;
		document.getElementById('form_tache').submit();
	}
</script>


<form id="form_tache" action="<?php echo url_for('tache/addCharge?tac_id='.$form->getObject()->getTacId()) ?>" method="post">

<?php echo $form->renderGlobalErrors() ?>
<?php echo $form->renderHiddenFields(false) ?>

<?php 
	if ($form->getObject()->isEnCours() || $form->getObject()->isEnAttente()) {
		echo $form['nouvelle_charge_restante']->renderError();
		echo $form['nouvelle_charge_consommee']->renderError();
		
		echo '<span class="titre">Nouvelle charge consommée/restante</span> : ';
		echo $form['nouvelle_charge_consommee']->render(array('size' => 5)); 
		echo $form['nouvelle_charge_restante']->render(array('size' => 5));

		echo '<p><input type="submit" value="Enregistrer"/> &nbsp;';
	} 
?>

<span class="titre">Etat suivant</span> :
<?php
	$i = 0;
	while (isset($form["etat_suivant_$i"])) {
		echo $form["etat_suivant_$i"] .' &nbsp; ';
		$i++;
	}
?>

</form>
